[id].vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. <template>
  2. <!-- 页面头部 -->
  3. <HomePageHead></HomePageHead>
  4. <!-- 导航栏 -->
  5. <HomePageNavigation1></HomePageNavigation1>
  6. <!-- 列表页广告一 -->
  7. <HomeTopTen :imgurl="adImg1" v-if="adImg1"></HomeTopTen>
  8. <!-- 面包屑导航 -->
  9. <div class="breadcrumb">
  10. <div class="inner">
  11. <span class="location">当前位置:</span>
  12. <el-breadcrumb :separator-icon="ArrowRight">
  13. <el-breadcrumb-item>
  14. <NuxtLink to="/">首页</NuxtLink>
  15. </el-breadcrumb-item>
  16. <el-breadcrumb-item v-show="name">
  17. <NuxtLink :to="{ path: `/primaryNavigation/${listid}`}">{{name}}</NuxtLink>
  18. </el-breadcrumb-item>
  19. <el-breadcrumb-item>
  20. {{ newsDetail.con_title }}
  21. </el-breadcrumb-item>
  22. </el-breadcrumb>
  23. </div>
  24. </div>
  25. <!-- 资讯列表 -->
  26. <div class="newsDetail">
  27. <div class="inner">
  28. <div class="innerLeft">
  29. <div class="leftBottomTitle">{{ newsDetail.con_title }}</div>
  30. <div class="leftBottom" v-html="newsDetail.content" v-if="newsDetail.content"></div>
  31. </div>
  32. <div class="innerRight">
  33. <div class="rightMenuTitle">导航列表</div>
  34. <ul>
  35. <li v-for="(item, index) in bottomMenu" :key="index">
  36. <NuxtLink :to="`/speciaArticle/${item.id}`" :title="item.name"
  37. v-if="item.id == pageId && item.id != 7" class="active">
  38. {{ item.name }}
  39. </NuxtLink>
  40. <NuxtLink :to="`/speciaArticle/${item.id}`" :title="item.name"
  41. v-else-if="item.id != pageId && item.id != 7">
  42. {{ item.name }}
  43. </NuxtLink>
  44. <NuxtLink :to="`/specialList/${item.id}`" :title="item.name"
  45. v-if="item.id == 7 && pageId == 7 && routeHref == '/specialList/7'" class="active">
  46. {{item.name }}
  47. </NuxtLink>
  48. <NuxtLink :to="`/specialList/${item.id}`" :title="item.name" v-else-if="item.id == 7">
  49. {{ item.name}}
  50. </NuxtLink>
  51. </li>
  52. </ul>
  53. </div>
  54. <div style="clear: both;"></div>
  55. </div>
  56. </div>
  57. <!-- 广告二 -->
  58. <HomeTopTen :imgurl="adImg2" v-if="adImg2"></HomeTopTen>
  59. <!-- 页面底部 -->
  60. <HomeFoot1></HomeFoot1>
  61. </template>
  62. <script setup>
  63. //1.页面依赖 start ---------------------------------------->
  64. import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
  65. import { ArrowRight } from '@element-plus/icons-vue'
  66. //获得跳转过来的id
  67. const route = useRoute();
  68. const articleId = route.params.id; //获得该页面的id
  69. const listid = route.query.listId; //获得该页面的id
  70. const name = route.query.listName; //获得该页面的id
  71. const pageId = route.params.id; //获得该页面的id
  72. const routeHref = route.href;
  73. //1.页面依赖 end ---------------------------------------->
  74. //2.页面数据 start ---------------------------------------->
  75. //广告列表
  76. let adImg1 = ref([]);
  77. let adImg2 = ref([]);
  78. async function getAdData(){
  79. const adData = await requestDataPromise('/web/getWebsiteAdvertisement',{method:'GET',query:{'ad_tag':'PAGE'}});
  80. adList.value = adData.data;
  81. if(adData.code==200){
  82. for(let item of adData.data){
  83. if(item.ad_tag == 'PAGE_0001'){
  84. adImg1.value = item;
  85. }
  86. if(item.ad_tag == 'PAGE_0002'){
  87. adImg2.value = item;
  88. }
  89. }
  90. }else{
  91. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  92. console.log("错误位置:获取详情页广告列表")
  93. console.log("后端错误反馈:",adData.message)
  94. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  95. }
  96. }
  97. getAdData();
  98. const newsDetail = ref({})
  99. const bottomMenu = ref([]);
  100. async function getPageData() {
  101. const mkdata = await requestDataPromise('/web/getWebsiteFooterCategoryInfo', {
  102. method: 'GET',
  103. query: {
  104. 'fcat_id': articleId
  105. },
  106. });
  107. newsDetail.value = mkdata.data;
  108. }
  109. getPageData();
  110. async function getPageMenu() {
  111. const mkdata = await requestDataPromise('/web/getWebsiteFooterCategory', {
  112. method: 'GET',
  113. query: {},
  114. });
  115. bottomMenu.value = mkdata.data;
  116. }
  117. getPageMenu();
  118. //2.页面数据 end ---------------------------------------->
  119. //4.设置seo信息 start---------------------------------------->
  120. //4.1 设置seo信息
  121. const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
  122. method: 'GET',
  123. query: {},
  124. });
  125. let seoTitle = setData.data.website_head.title;
  126. let seoDescription = setData.data.website_head.description;
  127. let seoKeywords = setData.data.website_head.keywords;
  128. let seoSuffix = setData.data.website_head.suffix;
  129. let seoName = setData.data.website_head.website_name;
  130. useSeoMeta({
  131. title: seoTitle + "_" + seoSuffix,
  132. meta: [
  133. { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix },
  134. { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix }
  135. ]
  136. });
  137. //4.设置seo信息 end---------------------------------------->
  138. </script>
  139. <style lang="less" scoped>
  140. //导航条
  141. .breadcrumb {
  142. width: 100%;
  143. height: 22px;
  144. margin-bottom: 30px;
  145. font-family: Microsoft YaHei, Microsoft YaHei;
  146. font-weight: 400;
  147. font-size: 20px;
  148. color: #666666;
  149. line-height: 23px;
  150. text-align: left;
  151. font-style: normal;
  152. text-transform: none;
  153. .el-breadcrumb::v-deep {
  154. display: inline-block;
  155. vertical-align: -4px;
  156. }
  157. /deep/.el-breadcrumb__inner a,
  158. /deep/.el-breadcrumb__inner.is-link {
  159. color: #666666;
  160. font-weight: 400;
  161. text-decoration: none;
  162. transition: var(--el-transition-color);
  163. }
  164. span {
  165. font-family: Microsoft YaHei, Microsoft YaHei;
  166. font-weight: 400;
  167. font-size: 20px;
  168. color: #666666;
  169. line-height: 23px;
  170. text-align: left;
  171. font-style: normal;
  172. text-transform: none;
  173. }
  174. span:hover {
  175. color: #666666;
  176. }
  177. .location {
  178. margin-right: 20px;
  179. width: 100px;
  180. height: 22px;
  181. font-family: Microsoft YaHei, Microsoft YaHei;
  182. font-weight: 400;
  183. font-size: 20px;
  184. color: #666666;
  185. line-height: 23px;
  186. text-align: left;
  187. font-style: normal;
  188. text-transform: none;
  189. }
  190. }
  191. // 资讯列表
  192. .newsDetail {
  193. width: 100%;
  194. //height: 1400px;
  195. margin-bottom: 70px;
  196. .inner {
  197. width: 1200px;
  198. //height: 1400px;
  199. font-size: 16px;
  200. .innerLeft {
  201. //height: 1400px;
  202. float: right;
  203. .LeftTop {
  204. //height: 522px;
  205. margin-top: 50px;
  206. >h1 {
  207. line-height: 40px;
  208. margin-bottom: 30px;
  209. font-family: Microsoft YaHei, Microsoft YaHei;
  210. font-weight: bold;
  211. font-size: 30px;
  212. color: #333333;
  213. }
  214. >p {
  215. height: 18px;
  216. line-height: 18px;
  217. font-family: Microsoft YaHei, Microsoft YaHei;
  218. font-weight: 400;
  219. font-size: 14px;
  220. color: #999999;
  221. span {
  222. margin-right: 40px;
  223. }
  224. }
  225. >img {
  226. width: 680px;
  227. height: 382px;
  228. padding: 50px 0px 60px 55px;
  229. }
  230. }
  231. .leftBottomTitle {
  232. color: #028E21;
  233. font-size: 24px;
  234. font-weight: bold;
  235. height: 60px;
  236. line-height: 60px;
  237. }
  238. .leftBottom {
  239. width: 790px;
  240. font-size: 20px;
  241. border-top: 1px solid #139602;
  242. padding-top: 40px;
  243. >h3,
  244. >p {
  245. text-indent: 2em;
  246. width: 790px;
  247. font-family: Microsoft YaHei, Microsoft YaHei;
  248. font-size: 20px;
  249. color: #333333;
  250. line-height: 23px;
  251. padding-bottom: 30px;
  252. }
  253. >h3 {
  254. font-weight: 600px;
  255. }
  256. >p {
  257. font-weight: 400;
  258. }
  259. }
  260. }
  261. .innerRight {
  262. width: 279px;
  263. .rightMenuTitle {
  264. width: 279px;
  265. height: 69px;
  266. font-size: 22px;
  267. font-weight: bold;
  268. line-height: 58px;
  269. text-align: center;
  270. color: #fff;
  271. background: url("http://img.bjzxtw.org.cn/master/bjzxtw/public/special/projectMoreTitle.png") no-repeat;
  272. margin-bottom: 30px;
  273. }
  274. ul {
  275. li {
  276. a {
  277. border-left: 5px solid #028E21;
  278. margin-bottom: 15px;
  279. font-size: 22px;
  280. display: block;
  281. height: 61px;
  282. line-height: 61px;
  283. color: #333333;
  284. text-align: center;
  285. background: #FBFBFB;
  286. }
  287. }
  288. }
  289. .active {
  290. border-left: 0;
  291. border: 1px solid #028E21;
  292. background: #fff;
  293. }
  294. }
  295. }
  296. }
  297. </style>